//
//  ChoosePayToolView.swift
//  LeGou
//
//  Created by lxm on 2022/8/1.
//

import UIKit

class ChoosePayToolView: XMBaseView {

    //MARK: --------------------属性--------------------
    var index = 0
    
    var confirmBlock : (()->())?

    //MARK: --------------------UI控件--------------------
    @IBOutlet weak var content: UIView!
    
    @IBOutlet weak var addContent: UIView!
    
    @IBOutlet weak var cardContent: UIView!
    
    @IBOutlet weak var aliContent: UIView!
    
    @IBOutlet weak var wechatContent: UIView!
    
    @IBOutlet weak var addButton: UIButton!
    
    @IBOutlet var buttonArray: [UIButton]!
    
    @IBOutlet weak var bankLabel: UILabel!
    
    @IBOutlet weak var wxLabel: UILabel!
    
    @IBOutlet weak var aliLabel: UILabel!
    
    //MARK: --------------------生命周期--------------------
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
        bindAction()
        addConstraints()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        setUI()
        bindAction()
        addConstraints()
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        ZMUtil.clipCircle(view: content, Corner: [.topLeft, .topRight], radius: 12)
    }
    
    //MARK: --------------------UI--------------------
    func setUI() {
    }
    
    func addConstraints() {
     
    }
    
    //MARK: --------------------methods--------------------
    func bindAction() {
        
    }
    
    @IBAction func onClose(_ sender: Any) {
        removeFromSuperview()
    }
    
    @IBAction func onConfirm(_ sender: Any) {
        if let confirmBlock = confirmBlock {
            confirmBlock()
        }
        removeFromSuperview()
    }
    
    @IBAction func onSelect(_ sender: UIButton) {
        buttonArray.forEach({$0.isSelected = false})
        sender.isSelected = true
        index = sender.tag - 100
    }
    
    
    //MARK: --------------------delegate--------------------

}
